//
//  TextFeildTableController.m
//  UILbrary
//
//  Created by mac on 16/7/18.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "TextFeildTableController.h"
#import "TextFieldDefaultStyle.h"
#import "TextFieldCellTableViewController.h"
@interface TextFeildTableController ()
@property (nonatomic,strong) NSArray *titleArr;
@end


@implementation TextFeildTableController
#pragma lazy 

- (void)viewDidLoad{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
}


-  (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.titleArr.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *cellID = @"TextFeildTableControllerCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    cell.textLabel.text = self.titleArr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.row) {
        case 0:
        {
            TextFieldDefaultStyle *textField = [[TextFieldDefaultStyle alloc] init];
            [self.navigationController pushViewController:textField animated:YES];
        }
            break;
            case 1:
        {
            TextFieldCellTableViewController *vc = [[TextFieldCellTableViewController alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
        default:
            break;
    }
}


#pragma mark - lazy

- (NSArray *)titleArr{
    return @[@"textField",@"cell为textField"];
}
@end
